
#include <Ice/Ice.h>
#include <{SVCNAME}.h>

using namespace std;
using namespace {NAMESPACE};

class {SVCNAME}Client : public Ice::Application
{
public:

    {SVCNAME}Client();

    virtual int run(int, char*[]);

private:

    void menu();
};

int
main(int argc, char* argv[])
{
    {SVCNAME}Client app;
    return app.main(argc, argv, "../etc/client.ini");
}

{SVCNAME}Client::{SVCNAME}Client() :
    //
    // Since this is an interactive demo we don't want any signal
    // handling.
    //
    Ice::Application(Ice::NoSignalHandling)
{
}

int
{SVCNAME}Client::run(int argc, char* argv[])
{
    if(argc > 1)
    {
        cerr << appName() << ": too many arguments" << endl;
        return EXIT_FAILURE;
    }

    {SVCNAME}Prx twoway = {SVCNAME}Prx::checkedCast(
        communicator()->propertyToProxy("{SVCNAME}.Proxy")->ice_twoway()->ice_timeout(-1)->ice_secure(false));
    if(!twoway)
    {
        cerr << argv[0] << ": invalid proxy" << endl;
        return EXIT_FAILURE;
    }
    {SVCNAME}Prx oneway = twoway->ice_oneway();
    {SVCNAME}Prx batchOneway = twoway->ice_batchOneway();
    {SVCNAME}Prx datagram = twoway->ice_datagram();
    {SVCNAME}Prx batchDatagram = twoway->ice_batchDatagram();


    /*
    //TODO change interface
    bool secure = false;
    int timeout = -1;
    int delay = 0;

    try
    {
        // e.g.: invoke
        twoway->someInterface();
        oneway->someInterface();
        // send greeting as batch oneway
        batchOneway->someInterface();
        // send greeting as datagram, secure datagrams are not supported!
        datagram->someInterface();
        // send greeting as batch datagram, secure datagrams are not supported!
        batchDatagram->someInterface();
        // flush all batch requests
        communicator()->flushBatchRequests();
        //e.g.: set timeout
        twoway->ice_timeout(timeout);
        oneway->ice_timeout(timeout);
        batchOneway = batchOneway->ice_timeout(timeout);
        //e.g.: switch secure mode on/off
        twoway = twoway->ice_secure(secure);
        oneway = oneway->ice_secure(secure);
        batchOneway = batchOneway->ice_secure(secure);
        //e.g.: shutdown server
        twoway->shutdown();
    }
    catch(const Ice::Exception& ex)
    {
        cerr << ex << endl;
    }
    */
    return EXIT_SUCCESS;
}


